﻿using Super.Hmi.Models.User;
using Super.Hmi.Utils.EventAggregator;
using Super.Hmi.ViewModels.Base;

namespace Super.Hmi.Global
{
    public class AppContext : ViewModelBase
    {
        public static readonly Lazy<AppContext> _instance = new Lazy<AppContext>(() => new AppContext());
        public static AppContext Instance => _instance.Value;
        private AppContext() { }
        /// <summary>
        /// 当前登录的账号
        /// </summary>
        private UserModel _loginUserModel = new UserModel();
        public UserModel LoginUserModel
        {
            get { return _loginUserModel; }
            set { SetProperty<UserModel>(ref _loginUserModel, value); }
        }
        /// <summary>
        /// 当前登录的账号的权限列表
        /// </summary>
        public List<string> AuthPermissionList = new List<string>();
        /// <summary>
        /// 事件聚合器，用于发布和订阅事件
        /// </summary>
        public readonly List<SubscriptionToken> EventTokenList = new List<SubscriptionToken>();
        /// <summary>
        /// Gitee路径
        /// </summary>
        public readonly string GiteeUri = "https://gitee.com/YuanXiaoHai/super-admin";
        /// <summary>
        /// 版本号
        /// </summary>
        public readonly string Version = "1.0.0";
    }
}
